<%@ page language="java" pageEncoding="UTF-8"%>
<div class="container" ng-controller="BlogCreateController">
	<div>
		<h3 style="color: #40AA53;">
			发表博客{{show}}
		</h3>
		<hr />
		
		<div class="col-lg-8">
			<form role="form" callback="save" validate>
				<div class="form-group">
					<label>
						标题
					</label>
					<input type="text" class="form-control" placeholder="请输入标题" name="name" ng-model="blog.title" rule="required;">
				</div>
				<div class="form-group">
					<label>
						排序
					</label>
					<select class="form-control" ng-model="blog.order">
						<option ng-repeat="order in orders" value="{{order.id}}" ng-selected="{{order.id==blog.order}}">
							{{order.name}}
						</option>
					</select>
				</div>
				<div class="form-group">
					<label>
						目录
					</label>
					<select class="form-control" ng-model="blog.catalog">
						<option ng-repeat="catalog in catalogs" value="{{catalog.id}}" ng-selected="{{catalog.id==blog.catalog}}">
							{{catalog.name}}
						</option>
					</select>
				</div>
				<div class="form-group">
					<label>
						选项
					</label>
					<br/>
					<label class="btn btn-default">
						<input type="checkbox" ng-model="blog.oneself" ng-checked="blog.oneself==true"> 私有
					</label>
					
					<label class="btn btn-default">
						<input type="checkbox" ng-model="blog.comment" ng-checked="blog.comment==true"> 允许评论
					</label>
				</div>
				
				<div class="form-group">
					<label>
						内容
					</label>
					<textarea name="content" rule="required;length[5]" ng-model="blog.content" editor-width="100%;" delay="0" editor></textarea>
				</div>
				<button type="submit" class="btn btn-success btn-sm">
					<i class="glyphicon glyphicon-ok-sign"></i> 发表博客
				</button>
			</form>
		</div>
	</div>
</div>